package com.poposchool.project.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.poposchool.project.common.Result;
import com.poposchool.project.entity.MsActive;
import com.poposchool.project.mapper.MsActiveMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/manageActive")
public class MsActiveController {

    @Autowired
    MsActiveMapper msActiveMapper;

    @GetMapping("/loadList")
    public Result loadActiveList(Integer isExamine){
        List<MsActive> msActiveList = msActiveMapper.loadActiveList(isExamine);
        return Result.success(msActiveList);
    }

    @GetMapping("/deleteActive")
    public Result deleteActive(String id){
        msActiveMapper.deleteById(id);
        return Result.success("删除成功");
    }

    @PostMapping("/updateActive")
    public Result updateActive(@RequestBody MsActive msActive){
        msActiveMapper.updateById(msActive);
        return Result.success("修改成功");
    }

}
